package packet;

import Events.BaseEvent;
import Events.CompositeEvent;
import shared.Consts.Priorities;
import server.Game;

/**
 *
 * @author Joel Garboden
 * Packet wrapper for events to be processed by the server
 */
public class TriggeredEventReq extends Request
{
  BaseEvent triggeredEvent;

  /**
   *
   * @param triggeredEvent
   */
  public TriggeredEventReq(BaseEvent triggeredEvent)
  {
    this.triggeredEvent = triggeredEvent;
    this.priority = Priorities.DATA_UPDATE;
  }

  @Override
  public boolean processRequest(Game game)
  {
    triggeredEvent.execEvent(game.playerList.get(playerID).getPortfolio());
    return true;
  }
}
